﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>I Ching Mouse Caster</title>
<!-- <script src='http://localhost/firebug/firebug-lite.js'></script>
 -->
	<style>
		* {
			cursor:crosshair;
		}
	</style>
	<script>
	//todo:Chrome 支持
		function init(){
			document.getElementById('out').value='';
			//document.getElementById('btns').style.display='none';
		}
	</script>
</head>

<body onload='init()' unselectable="on" scroll='no'>
	<table height="100%" width="100%" unselectable="on" >
		<tr height='95%'>
			<td width='50%' >
				<textarea id="out" name='unselectableObj' style="overflow:hidden; height: 100%; width: 100%;-moz-user-select:none;" unselectable="on">
				</textarea>
			</td>
			<td width='50%' unselectable="on" >
				<textarea id="readme"  name='unselectableObj' style="overflow:hidden;height: 100%; width: 100%;-moz-user-select:none;" unselectable="on">
==易经鼠标起卦器==

===步骤===
 1. 想一想要占卜的事(可选) 
 2. 按住鼠标左键 
 3. 随意晃动鼠标 
 4. 松开鼠标左键,产生一爻 
 5. 重复步骤1->4,直到产生一卦 

===说明===
 * 本程序没有使用任何伪随机数生成器
 * 完全根据您的随机动作起卦
 * 概率与使用三枚硬币的经典方法相同,参见(http://www.dentato.it/iching/)(无法直接访问 需戴tor)

===感谢===
衷心感谢以下网站提供资源
 * 法国汉语教师协会网站(卫礼贤)
 * 周易天地(焦氏易林) (但我不认同该网站的观点)

===联系我===
androidgao@gmail.com
				</textarea>
			</td>
		</tr>
		<tr id="btns" height='5%' style='display:none'>
			<td colspan='2' align="center">
				<button onclick='reset()'>再次占卜? </button><br >
				本次占卜链接: <a id='卫礼贤' href='#' target='_blank'>卫礼贤(Richard Wilhelm)</a> | <a id='焦氏易林' href='#' target='_blank'>焦氏易林</a>
			</td>
		</tr>
	</table>
</body>
</html>
<script>
function reset(){
	document.getElementById('btns').style.display='none';
	var out = document.getElementById('out');
	out.select();//for ie scroll to top; ff no need
	out.style.overflow = 'hidden';

	toggleUnselectableObj();
	
	hexagram = [];
	document.onmousedown = begin;
	document.onmouseup = end;
	
}
var getXXfrom3coins = function(c1,c2,c3){
//c1,c2,c3 are 0 or 1
	return c1+c2+c3; //return 6,7,8,9
};


var mouseUpDownMethod = {

	c1_begin : 0,
	c2_begin : 0,
	c3_begin : 0,
	c1_end : 0,
	c2_end : 0,
	c3_end : 0,
	get3Coins: function(){
	//实现3个硬币接口
		return {
			c1 : 2 + Math.abs(this.c1_end-this.c1_begin)%2,
			c2 : 2 + Math.abs(this.c2_end-this.c2_begin)%2,
			c3 : 2 + Math.abs(this.c3_end-this.c3_begin)%2,
			toString : function(){
				var ret = '(' + [this.c1 ,this.c2 ,this.c3].join('+') + ')';
				switch(this.c1 + this.c2 + this.c3){
					case 6:
						ret += "   -x-   ->   ---";
						break;
					case 7:
						ret += "   ---   ->   ---";
						break;
					case 8:
						ret += "   - -   ->   - -";
						break;
					case 9:
						ret += "   -o-   ->   - -";
						break;
				}
				return ret;
			}
		}
	}
};

//var pseudoRandomNumberMethod = {
//	get3Coins: function(){
//		return {
//			c1:Math.floor(2*Math.random()),
//			c2:Math.floor(2*Math.random()),
//			c3:Math.floor(2*Math.random())
//		}
//	}
//}

var begin = function (event){
	event = window.event? window.event : event;
	mouseUpDownMethod.c1_begin = event.clientX;
	mouseUpDownMethod.c2_begin = event.clientY;
	mouseUpDownMethod.c3_begin = new Date().getTime();
}

document.onmousedown = begin;
var hexagram =[];

var end = function (event){
	event = window.event? window.event : event;
	
	mouseUpDownMethod.c1_end = event.clientX;
	mouseUpDownMethod.c2_end = event.clientY;
	mouseUpDownMethod.c3_end = new Date().getTime();
	//console.log(mouseUpDownMethod);
	var coins = mouseUpDownMethod.get3Coins();
	//console.log(coins);
	if(hexagram.length<6){
		
		hexagram.push(getXXfrom3coins(coins.c1,coins.c2,coins.c3));
		//console.log(hexagram);
		document.getElementById('out').value = hexagram.slice(-1) + '=' + coins + '\n' 
			+ document.getElementById('out').value;
	}
	
	if(hexagram.length==6){
		document.onmousedown = null;
		document.onmouseup = null;
		output();
		
		document.getElementById('btns').style.display = '';
		document.getElementById('out').style.overflow = 'auto';
		toggleUnselectableObj();
	}
	
}
document.onmouseup = end;

function toggleUnselectableObj(){
	var usos = document.getElementsByName('unselectableObj');
	for(var i=0;i<usos.length;i++){
		usos[i].unselectable = usos[i].unselectable=='on' ? 'off' : 'on';
		usos[i].style.MozUserSelect = usos[i].style.MozUserSelect=='none' ? '': 'none';
	}
}


var Trigrams={
	"|||":{"names":{"zh":"乾","pinYin":"qián","en":"the Creative, Force"},"imageInNature":{"zh":"天","en":"heaven,aether"}},
	"||¦":{"names":{"zh":"兌","pinYin":"duì","en":"the Joyous, Open"},"imageInNature":{"zh":"澤","en":"swamp,marsh"}},
	"|¦|":{"names":{"zh":"離","pinYin":"lí","en":"the Clinging, Radiance"},"imageInNature":{"zh":"火","en":"fire"}},
	"|¦¦":{"names":{"zh":"震","pinYin":"zhèn","en":"the Arousing, Shake"},"imageInNature":{"zh":"雷","en":"thunder"}},
	"¦||":{"names":{"zh":"巽","pinYin":"xùn","en":"the Gentle, Ground"},"imageInNature":{"zh":"風","en":"wind,wood"}},
	"¦|¦":{"names":{"zh":"坎","pinYin":"kǎn","en":"the Abysmal, Gorge"},"imageInNature":{"zh":"水","en":"water"}},
	"¦¦|":{"names":{"zh":"艮","pinYin":"gèn","en":"Keeping Still, Bound"},"imageInNature":{"zh":"山","en":"mountain"}},
	"¦¦¦":{"names":{"zh":"坤","pinYin":"kūn","en":"the Receptive, Field"},"imageInNature":{"zh":"地","en":"earth"}}
};
//todo 图解周易网站的no
//法国网站的网址

var Hexagrams={
	"||||||":{"no":1,"names":{"zh":"乾","wilhelm":"The Creative","pinYin":"qián","en":"Force"},"modernInterpretations":{"en":"Possessing Creative Power & Skill","zh":"具有创造力和技巧的"}},
	"¦¦¦¦¦¦":{"no":2,"names":{"zh":"坤","wilhelm":"The Receptive","pinYin":"kūn","en":"Field"},"modernInterpretations":{"en":"Needing Knowledge & Skill; Do not force matters and go with the flow","zh":""}},
	"|¦¦¦|¦":{"no":3,"names":{"zh":"屯","wilhelm":"Difficulty at the Beginning","pinYin":"chún","en":"Sprouting"},"modernInterpretations":{"en":"Sprouting","zh":"发芽,萌发"}},
	"¦|¦¦¦|":{"no":4,"names":{"zh":"蒙","wilhelm":"Youthful Folly","pinYin":"méng","en":"Enveloping"},"modernInterpretations":{"en":"Detained, Enveloped and Inexperienced","zh":""}},
	"|||¦|¦":{"no":5,"names":{"zh":"需","wilhelm":"Waiting","pinYin":"xū","en":"Attending"},"modernInterpretations":{"en":"Uninvolvement (Wait for now), Nourishment","zh":""}},
	"¦|¦|||":{"no":6,"names":{"zh":"訟","wilhelm":"Conflict","pinYin":"sòng","en":"Arguing"},"modernInterpretations":{"en":"Engagement in Conflict","zh":""}},
	"¦|¦¦¦¦":{"no":7,"names":{"zh":"師","wilhelm":"The Army","pinYin":"shī","en":"Leading"},"modernInterpretations":{"en":"Bringing Together, Teamwork","zh":""}},
	"¦¦¦¦|¦":{"no":8,"names":{"zh":"比","wilhelm":"Holding Together","pinYin":"bǐ","en":"Grouping"},"modernInterpretations":{"en":"Union","zh":""}},
	"|||¦||":{"no":9,"names":{"zh":"小畜","wilhelm":"Small Taming","pinYin":"xiǎo chù","en":"Small Accumulating"},"modernInterpretations":{"en":"Accumulating Resources","zh":""}},
	"||¦|||":{"no":10,"names":{"zh":"履","wilhelm":"Treading (Conduct)","pinYin":"lǚ","en":"Treading"},"modernInterpretations":{"en":"Continuing with Alertness","zh":""}},
	"|||¦¦¦":{"no":11,"names":{"zh":"泰","wilhelm":"Peace","pinYin":"tài","en":"Pervading"},"modernInterpretations":{"en":"Pervading","zh":""}},
	"¦¦¦|||":{"no":12,"names":{"zh":"否","wilhelm":"Standstill","pinYin":"pǐ","en":"Obstruction"},"modernInterpretations":{"en":"Stagnation","zh":"停滞"}},
	"|¦||||":{"no":13,"names":{"zh":"同人","wilhelm":"Fellowship","pinYin":"tóng rén","en":"Concording People"},"modernInterpretations":{"en":"Fellowship, Partnership","zh":"伙伴关系,合作关系"}},
	"||||¦|":{"no":14,"names":{"zh":"大有","wilhelm":"Great Possession","pinYin":"dà yǒu","en":"Great Possessing"},"modernInterpretations":{"en":"Independence, Freedom","zh":""}},
	"¦¦|¦¦¦":{"no":15,"names":{"zh":"謙","wilhelm":"Modesty","pinYin":"qiān","en":"Humbling"},"modernInterpretations":{"en":"Being Reserved, Refraining","zh":""}},
	"¦¦¦|¦¦":{"no":16,"names":{"zh":"豫","wilhelm":"Enthusiasm","pinYin":"yù","en":"Providing-For"},"modernInterpretations":{"en":"Inducement, New Stimulus","zh":""}},
	"|¦¦||¦":{"no":17,"names":{"zh":"隨","wilhelm":"Following","pinYin":"suí","en":"Following"},"modernInterpretations":{"en":"Following","zh":""}},
	"¦||¦¦|":{"no":18,"names":{"zh":"蠱","wilhelm":"Work on the Decayed","pinYin":"gǔ","en":"Corrupting"},"modernInterpretations":{"en":"Repairing","zh":""}},
	"||¦¦¦¦":{"no":19,"names":{"zh":"臨","wilhelm":"Approach","pinYin":"lín","en":"Nearing"},"modernInterpretations":{"en":"Approaching Goal, Arriving","zh":""}},
	"¦¦¦¦||":{"no":20,"names":{"zh":"觀","wilhelm":"Contemplation","pinYin":"guān","en":"Viewing"},"modernInterpretations":{"en":"The Withholding","zh":""}},
	"|¦¦|¦|":{"no":21,"names":{"zh":"噬嗑","wilhelm":"Biting Through","pinYin":"shì kè","en":"Gnawing Bite"},"modernInterpretations":{"en":"Deciding","zh":""}},
	"|¦|¦¦|":{"no":22,"names":{"zh":"賁","wilhelm":"Grace","pinYin":"bì","en":"Adorning"},"modernInterpretations":{"en":"Embellishing","zh":""}},
	"¦¦¦¦¦|":{"no":23,"names":{"zh":"剝","wilhelm":"Splitting Apart","pinYin":"bō","en":"Stripping"},"modernInterpretations":{"en":"Stripping, Flaying","zh":""}},
	"|¦¦¦¦¦":{"no":24,"names":{"zh":"復","wilhelm":"Return","pinYin":"fù","en":"Returning"},"modernInterpretations":{"en":"Returning","zh":""}},
	"|¦¦|||":{"no":25,"names":{"zh":"無妄","wilhelm":"Innocence","pinYin":"wú wàng","en":"Without Embroiling"},"modernInterpretations":{"en":"Without Rashness","zh":""}},
	"|||¦¦|":{"no":26,"names":{"zh":"大畜","wilhelm":"Great Taming","pinYin":"dà chù","en":"Great Accumulating"},"modernInterpretations":{"en":"Accumulating Wisdom","zh":""}},
	"|¦¦¦¦|":{"no":27,"names":{"zh":"頤","wilhelm":"Mouth Corners","pinYin":"yí","en":"Swallowing"},"modernInterpretations":{"en":"Seeking Nourishment","zh":""}},
	"¦||||¦":{"no":28,"names":{"zh":"大過","wilhelm":"Great Preponderance","pinYin":"dà guò","en":"Great Exceeding"},"modernInterpretations":{"en":"Great Surpassing","zh":""}},
	"¦|¦¦|¦":{"no":29,"names":{"zh":"坎","wilhelm":"The Abysmal Water","pinYin":"kǎn","en":"Gorge"},"modernInterpretations":{"en":"Darkness, Gorge","zh":""}},
	"|¦||¦|":{"no":30,"names":{"zh":"離","wilhelm":"The Clinging","pinYin":"lí","en":"Radiance"},"modernInterpretations":{"en":"Clinging, Attachment","zh":""}},
	"¦¦|||¦":{"no":31,"names":{"zh":"咸","wilhelm":"Influence","pinYin":"xián","en":"Conjoining"},"modernInterpretations":{"en":"Attraction","zh":""}},
	"¦|||¦¦":{"no":32,"names":{"zh":"恆","wilhelm":"Duration","pinYin":"héng","en":"Persevering"},"modernInterpretations":{"en":"Perseverance","zh":""}},
	"¦¦||||":{"no":33,"names":{"zh":"遯","wilhelm":"Retreat","pinYin":"dùn","en":"Retiring"},"modernInterpretations":{"en":"Withdrawing","zh":""}},
	"||||¦¦":{"no":34,"names":{"zh":"大壯","wilhelm":"Great Power","pinYin":"dà zhuàng","en":"Great Invigorating"},"modernInterpretations":{"en":"Great Boldness","zh":""}},
	"¦¦¦|¦|":{"no":35,"names":{"zh":"晉","wilhelm":"Progress","pinYin":"jìn","en":"Prospering"},"modernInterpretations":{"en":"Expansion, Promotion","zh":""}},
	"|¦|¦¦¦":{"no":36,"names":{"zh":"明夷","wilhelm":"Darkening of the Light","pinYin":"míng yí","en":"Brightness Hiding"},"modernInterpretations":{"en":"Brilliance Injured","zh":""}},
	"|¦|¦||":{"no":37,"names":{"zh":"家人","wilhelm":"The Family","pinYin":"jiā rén","en":"Dwelling People"},"modernInterpretations":{"en":"Family","zh":""}},
	"||¦|¦|":{"no":38,"names":{"zh":"睽","wilhelm":"Opposition","pinYin":"kuí","en":"Polarising"},"modernInterpretations":{"en":"Division, Divergence","zh":""}},
	"¦¦|¦|¦":{"no":39,"names":{"zh":"蹇","wilhelm":"Obstruction","pinYin":"jiǎn","en":"Limping"},"modernInterpretations":{"en":"Halting, Hardship","zh":""}},
	"¦|¦|¦¦":{"no":40,"names":{"zh":"解","wilhelm":"Deliverance","pinYin":"xiè","en":"Taking-Apart"},"modernInterpretations":{"en":"Liberation, Solution","zh":"解放,解决"}},
	"||¦¦¦|":{"no":41,"names":{"zh":"損","wilhelm":"Decrease","pinYin":"sǔn","en":"Diminishing"},"modernInterpretations":{"en":"Decrease","zh":"减少"}},
	"|¦¦¦||":{"no":42,"names":{"zh":"益","wilhelm":"Increase","pinYin":"yì","en":"Augmenting"},"modernInterpretations":{"en":"Increase","zh":"增加"}},
	"|||||¦":{"no":43,"names":{"zh":"夬","wilhelm":"Breakthrough","pinYin":"guài","en":"Parting"},"modernInterpretations":{"en":"Separation","zh":"分离"}},
	"¦|||||":{"no":44,"names":{"zh":"姤","wilhelm":"Coming to Meet","pinYin":"gòu","en":"Coupling"},"modernInterpretations":{"en":"Encountering","zh":""}},
	"¦¦¦||¦":{"no":45,"names":{"zh":"萃","wilhelm":"Gathering Together","pinYin":"cuì","en":"Clustering"},"modernInterpretations":{"en":"Association, Companionship","zh":""}},
	"¦||¦¦¦":{"no":46,"names":{"zh":"升","wilhelm":"Pushing Upward","pinYin":"shēng","en":"Ascending"},"modernInterpretations":{"en":"Growing Upward","zh":""}},
	"¦|¦||¦":{"no":47,"names":{"zh":"困","wilhelm":"Oppression","pinYin":"kùn","en":"Confining"},"modernInterpretations":{"en":"Exhaustion","zh":""}},
	"¦||¦|¦":{"no":48,"names":{"zh":"井","wilhelm":"The Well","pinYin":"jǐng","en":"Welling"},"modernInterpretations":{"en":"Replenishing, Renewal","zh":""}},
	"|¦|||¦":{"no":49,"names":{"zh":"革","wilhelm":"Revolution","pinYin":"gé","en":"Skinning"},"modernInterpretations":{"en":"Abolishing the Old","zh":"除旧"}},
	"¦|||¦|":{"no":50,"names":{"zh":"鼎","wilhelm":"The Cauldron","pinYin":"dǐng","en":"Holding"},"modernInterpretations":{"en":"Establishing the New","zh":""}},
	"|¦¦|¦¦":{"no":51,"names":{"zh":"震","wilhelm":"Arousing","pinYin":"zhèn","en":"Shake"},"modernInterpretations":{"en":"Mobilizing","zh":""}},
	"¦¦|¦¦|":{"no":52,"names":{"zh":"艮","wilhelm":"The Keeping Still","pinYin":"gèn","en":"Bound"},"modernInterpretations":{"en":"Immobility","zh":""}},
	"¦¦|¦||":{"no":53,"names":{"zh":"漸","wilhelm":"Development","pinYin":"jiàn","en":"Infiltrating"},"modernInterpretations":{"en":"Auspicious Outlook, Infiltration","zh":""}},
	"||¦|¦¦":{"no":54,"names":{"zh":"歸妹","wilhelm":"The Marrying Maiden","pinYin":"guī mèi","en":"Converting The Maiden"},"modernInterpretations":{"en":"Marrying","zh":"婚嫁"}},
	"|¦||¦¦":{"no":55,"names":{"zh":"豐","wilhelm":"Abundance","pinYin":"fēng","en":"Abounding"},"modernInterpretations":{"en":"Goal Reached, Ambition Achieved","zh":""}},
	"¦¦||¦|":{"no":56,"names":{"zh":"旅","wilhelm":"The Wanderer","pinYin":"lǚ","en":"Sojourning"},"modernInterpretations":{"en":"Travel","zh":""}},
	"¦||¦||":{"no":57,"names":{"zh":"巽","wilhelm":"The Gentle","pinYin":"xùn","en":"Ground"},"modernInterpretations":{"en":"Subtle Influence","zh":""}},
	"||¦||¦":{"no":58,"names":{"zh":"兌","wilhelm":"The Joyous","pinYin":"duì","en":"Open"},"modernInterpretations":{"en":"Overt Influence","zh":""}},
	"¦|¦¦||":{"no":59,"names":{"zh":"渙","wilhelm":"Dispersion","pinYin":"huàn","en":"Dispersing"},"modernInterpretations":{"en":"Dispersal","zh":""}},
	"||¦¦|¦":{"no":60,"names":{"zh":"節","wilhelm":"Limitation","pinYin":"jié","en":"Articulating"},"modernInterpretations":{"en":"Discipline","zh":""}},
	"||¦¦||":{"no":61,"names":{"zh":"中孚","wilhelm":"Inner Truth","pinYin":"zhōng fú","en":"Centre Confirming"},"modernInterpretations":{"en":"Staying Focused, Avoid Misrepresentation","zh":""}},
	"¦¦||¦¦":{"no":62,"names":{"zh":"小過","wilhelm":"Small Preponderance","pinYin":"xiǎo guò","en":"Small Exceeding"},"modernInterpretations":{"en":"Small Surpassing","zh":""}},
	"|¦|¦|¦":{"no":63,"names":{"zh":"既濟","wilhelm":"After Completion","pinYin":"jì jì","en":"Already Fording"},"modernInterpretations":{"en":"Completion","zh":"完成"}},
	"¦|¦|¦|":{"no":64,"names":{"zh":"未濟","wilhelm":"Before Completion","pinYin":"wèi jì","en":"Not-Yet Fording"},"modernInterpretations":{"en":"Incompletion","zh":"未完成"}}
}
var getUnicode=function(no){
	
}

var output=function(){
	
	var show=[];
	var _show=[];
	var hexagramZipped=[];	//only consider odd even
	var _hexagramZipped=[];
	var willChange = false;
	for(var i=0;i<6;i++){
		switch(hexagram[i]){
			case 6:
				hexagramZipped[i]="¦";
				show[i]="-x-";
				_hexagramZipped[i]="|";
				_show[i]="---";
				willChange = true;
				break;
			case 7:
				hexagramZipped[i]="|";
				show[i]="---";
				_hexagramZipped[i]="|";
				_show[i]="---";
				break;
			case 8:
				hexagramZipped[i]="¦";
				show[i]="- -";
				_hexagramZipped[i]="¦";
				_show[i]="- -";
				break;
			case 9:
				hexagramZipped[i]="|";
				show[i]="-o-";
				_hexagramZipped[i]="¦";
				_show[i]="- -";
				willChange = true;
				break;
		}
	}

	var out = "\n\n=== " + new Date().toLocaleString()+ " ===\n\n";
	for(var k=5;k>=0;k--){
		if(willChange){
			out += show[k]+'   ->   '+_show[k]+'\n';
		}
		else{
			out += show[k]+'\n';
		}
	}
	
	var lower = hexagramZipped[0]+hexagramZipped[1]+hexagramZipped[2];
	var _lower = _hexagramZipped[0]+_hexagramZipped[1]+_hexagramZipped[2];
	var upper = hexagramZipped[3]+hexagramZipped[4]+hexagramZipped[5];
	var _upper = _hexagramZipped[3]+_hexagramZipped[4]+_hexagramZipped[5];
	var lowerAndUpper = hexagramZipped.join("");
	var _lowerAndUpper = _hexagramZipped.join("");
	
	var no = Hexagrams[lowerAndUpper].no;
	var _no = Hexagrams[_lowerAndUpper].no;
	
	if(upper==lower){
		out += Trigrams[upper].names.zh + "为" + Trigrams[upper].imageInNature.zh;
	}
	else{
		out += Trigrams[upper].imageInNature.zh + Trigrams[lower].imageInNature.zh + Hexagrams[lowerAndUpper].names.zh;
	}
	
	out += '(' + no + ')';
	if(willChange){
		out += ' -> ';
		if(_upper==_lower){
			out += Trigrams[_upper].names.zh + "为" + Trigrams[_upper].imageInNature.zh;
		}
		else{
			out += Trigrams[_upper].imageInNature.zh + Trigrams[_lower].imageInNature.zh + Hexagrams[_lowerAndUpper].names.zh;
		}
		out += '(' + _no + ')';
	}
	
	
	var afpcURL = "http://afpc.asso.fr/wengu/wg/wengu.php?l=Yijing&tire=" 
		+ hexagram.join('') + "&no=" + no + "&lang=en";
	var 焦氏易林 = "http://www.64gua.com/ebook/jsyl/html/j" + new Number(no/100).toFixed(2).slice(-2) + ".html";
	//焦氏易林备份地址 http://www.chineseclassic.com/13jing/yi/giau/53.htm
	
	out += '\n\n[links]\n' + '卫礼贤: ' + afpcURL 
		+ '\n\n焦氏易林: ' + 焦氏易林 + '\n[/links]';
	
	document.getElementById('卫礼贤').href = afpcURL;
	document.getElementById('焦氏易林').href = 焦氏易林;
	window.setTimeout(function(){
		window.open(afpcURL);
		window.open(焦氏易林);
	},500);
	
	
	//out+="图解周易网址:"; //


	document.getElementById("out").value = out + '\n\n' 
		+ document.getElementById("out").value;
	
	//document.getElementById("ifm").src="http://www.google.com/search?q="+encodeURIComponent(Hexagrams[lowerAndUpper].names.zh);
	
}

</script>